//
//  ZCFollowViewController.m
//  ZCBaiSi
//
//  Created by zc on 16/7/6.
//  Copyright © 2016年 zc. All rights reserved.
//

#import "ZCFollowViewController.h"
#import "ZCRecommendFollowViewController.h"
#import "ZCLoginRegisterViewController.h"
@implementation ZCFollowViewController

- (void)viewDidLoad{
    [super viewDidLoad];
    self.view.backgroundColor = ZCCommonBgColor;
    
    //标题 （不建议使用self.title）
    self.navigationItem. title = @"我的关注";
    //左边按钮
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImage:@"friendsRecommentIcon" highImage:@"friendsRecommentIcon-click" target:self action:@selector(followClick)];
    
    UILabel *lab = [[UILabel alloc]initWithFrame:CGRectMake(100, 100, 200, 25)];
    lab.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:lab];
    
    //图文混排
    NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc]init];
    
    NSMutableAttributedString *one = [[NSMutableAttributedString alloc]initWithString:@"你好"];
    
    [attributedText appendAttributedString:one];
    
    NSTextAttachment *attachment = [[NSTextAttachment alloc]init];
    attachment.image = [UIImage imageNamed:@"header_cry_icon"];
    attachment.bounds = CGRectMake(0, -3, 25, 25);
    NSAttributedString *two = [NSAttributedString attributedStringWithAttachment:attachment];
    [attributedText appendAttributedString:two];
    
    NSMutableAttributedString *three = [[NSMutableAttributedString alloc]initWithString:@"哈哈哈"];
    [attributedText appendAttributedString:three];
    lab.attributedText = attributedText;
}
- (IBAction)loginRegister:(id)sender {
    ZCLoginRegisterViewController *login = [[ZCLoginRegisterViewController alloc]init];
    [self presentViewController:login animated:YES completion:nil];
}

- (void)followClick{
    ZCRecommendFollowViewController *con = [[ZCRecommendFollowViewController alloc]init];
    [self.navigationController pushViewController:con animated:YES];
}
@end
